/** Interactive Surface  FYP- 25 Interactive Surface FYP- 25 Interactive Surface FYP- 25
 *
 *  @author Acer
 */

package objectExtraction;


import com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;

/** Interactive Surface FYP- 25 Interactive Surface FYP- 25 Interactive Surface FYP- 25
 *  General Information about this class -
 *  Comments -
 */

public class YCrCbSkinDetector {
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

    CvScalar ycc_min = cvScalar(0, 131, 80, 0);
    CvScalar ycc_max = cvScalar(255, 185, 135, 0);

    IplImage detectSkin(IplImage image) {
        IplImage imgHSV = cvCreateImage(cvGetSize(image), 8, 3);
        IplImage imgThreshold = cvCreateImage(cvGetSize(image), 8, 1);

        cvCvtColor(image, imgHSV, CV_BGR2YCrCb);
        cvInRangeS(imgHSV, ycc_min, ycc_max, imgThreshold);
        return imgThreshold;
    }
}

